import { createRouter,createWebHistory } from "vue-router";
export default  createRouter({
    history:createWebHistory(),
    routes:[
        {
            path:'/home',
            component:()=>import('@/pages/Home/index.vue')
        },
        {
            path:'/hospital',
            component:()=>import('@/pages/Hispital/index.vue'),
            children:[
                {
                    path:'detial',
                    component:()=>import('@/pages/Hispital/detial/index.vue')
                },
                {
                    path:'notice',
                    component:()=>import('@/pages/Hispital/notice/index.vue')
                },
                {
                    path:'registration',
                    component:()=>import('@/pages/Hispital/registration/index.vue')
                },
                {
                    path:'Select',
                    component:()=>import('@/pages/Hispital/Select/index.vue')
                },
                {
                    path:'Suspension',
                    component:()=>import('@/pages/Hispital/Suspension/index.vue')
                },
                {
                    path:'registration_step1',
                    component:()=>import('@/pages/Hispital/registration/registration_step1.vue')
                },
                {
                    path:'registration_step2',
                    component:()=>import('@/pages/Hispital/registration/registration_step2.vue')
                }
            ]
        },
        {
            path:'/user',
            component:()=>import('@/pages/user/index.vue'),
            children:[
                {
                    path:'authentication',//认证路由
                    component:()=>import('@/pages/user/authentication/index.vue')
                },
                {
                    path:'orders',//订单
                    component:()=>import('@/pages/user/orders/index.vue')
                },
                {
                    path:'manage',//管理
                    component:()=>import('@/pages/user/manage/index.vue')
                },
                {
                    path:'Feedback',//反馈
                    component:()=>import('@/pages/user/Feedback/index.vue')
                },
                {
                    path:'Account',
                    component:()=>import('@/pages/user/Account/index.vue')
                }
            ]
        },
        //重定向到home首页
        {
            path:'/',
            redirect:'/home',
        }
    ],
    //滚动行为
    scrollBehavior(){
        return {
            top:0,
            left:0
        }
    }
})